package com.xf.common.core.enums;

/**
 * 数据状态枚举
 */
public enum IsDelEnum {
    NORMAL(0, "正常"),
    DELETE(1, "删除"),
    ;

    private int code;
    private String desc;

    IsDelEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static IsDelEnum parse(int type) {
        for (IsDelEnum operationEnum : IsDelEnum.values()) {
            if (operationEnum.getCode() == type) {
                return operationEnum;
            }
        }
        return null;
    }

}
